<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{$name}}</title>
</head>
<body>
<div id="divID">Hello</div>
<script>
    var eventSource = new EventSource("http://192.168.33.10:9301/chat");
    var div = document.getElementById('divID');


    eventSource.onmessage = function (e) {
        console.log('message')
        console.log(e)
    };
    eventSource.onerror = function (e) {
        console.log('error')
        console.log(e);
        eventSource.close();
    };
</script>
</body>
</html>